home *** CD-ROM | disk | FTP | other *** search
- /********************************************
- ; File: GSOS.h
- ;
- ;
- ; Copyright Apple Computer, Inc. 1988
- ; All Rights Reserved
- ;
- ********************************************/
-
- #ifndef __types__
- #include <types.h>
- #endif
-
- #ifndef __GSOS__
- #define __GSOS__
-
- #define readEnable 0x0001 /*access - read enable bit: CreateRec, OpenRec access and requestAccess fields */
- #define writeEnable 0x0002 /*access - write enable bit: CreateRec, OpenRec access and requestAccess fields */
- #define backupNeeded 0x0020 /*access - backup needed bit: CreateRec, OpenRec access field. (Must be 0 in requestAccess field ) */
- #define renameEnable 0x0040 /*access - rename enable bit: CreateRec, OpenRec access and requestAccess fields */
- #define destroyEnable 0x0080 /*access - read enable bit: CreateRec, OpenRec access and requestAccess fields */
-
- #define startPlus 0x0000 /*base - setMark = displacement */
- #define eofMinus 0x0001 /*base - setMark = eof - displacement */
- #define markPlus 0x0002 /*base - setMark = mark + displacement */
- #define markMinus 0x0003 /*base - setMark = mark - displacement */
-
- #define noCache 0x0000 /*cachePriority - do not cache blocks invloved in this read */
- #define cache 0x0001 /*cachePriority - cache blocks invloved in this read if possible */
-
- #define badSystemCall 0x0001 /*error - bad system call number */
- #define invalidPcount 0x0004 /*error - invalid parameter count */
- #define gsosActive 0x07 /*error - GS/OS already active */
- #ifndef devNotFound /*error - device not found */
- #define devNotFound 0x10
- #endif
- #define invalidDevNum 0x11 /*error - invalid device number */
- #define drvrBadReq 0x20 /*error - bad request or command */
- #define drvrBadCode 0x0021 /*error - bad control or status code */
- #define drvrBadParm 0x0022 /*error - bad call parameter */
- #define drvrNotOpen 0x0023 /*error - character device not open */
- #define drvrPriorOpen 0x0024 /*error - character device already open */
- #define irqTableFull 0x0025 /*error - interrupt table full */
- #define drvrNoResrc 0x0026 /*error - resources not available */
- #define drvrIOError 0x0027 /*error - I/O error */
- #define drvrNoDevice 0x0028 /*error - device not connected */
- #define drvrBusy 0x0029 /*error - call aborted, driver is busy */
- #define drvrWrtProt 0x002B /*error - device is write protected */
- #define drvrBadCount 0x002C /*error - invalid byte count */
- #define drvrBadBlock 0x002D /*error - invalid block address */
- #define drvrDiskSwitch 0x002E /*error - disk has been switched */
- #define drvrOffLine 0x002F /*error - device off line/ no media present */
- #define badPathSyntax 0x0040 /*error - invalid pathname syntax */
- #define invalidRefNum 0x0043 /*error - invalid reference number */
- #ifndef pathNotFound /*error - subdirectory does not exist */
- #define pathNotFound 0x44
- #endif
- #define volNotFound 0x0045 /*error - volume not found */
- #ifndef fileNotFound /*error - file not found */
- #define fileNotFound 0x0046
- #endif
- #define dupPathname 0x0047 /*error - create or rename with existing name */
- #define volumeFull 0x0048 /*error - volume full error */
- #define volDirFull 0x0049 /*error - volume directory full */
- #define badFileFormat 0x004A /*error - version error (incompatible file format) */
- #ifndef badStoreType /*error - unsupported (or incorrect) storage type */
- #define badStoreType 0x004B
- #endif
- #ifndef eofEncountered /*error - end-of-file encountered */
- #define eofEncountered 0x004C
- #endif
- #define outOfRange 0x004D /*error - position out of range */
- #define invalidAccess 0x004E /*error - access not allowed */
- #define buffTooSmall 0x004F /*error - buffer too small */
- #define fileBusy 0x0050 /*error - file is already open */
- #define dirError 0x0051 /*error - directory error */
- #define unknownVol 0x0052 /*error - unknown volume type */
- #ifndef paramRangeErr /*error - parameter out of range */
- #define paramRangeErr 0x0053
- #endif
- #define outOfMem 0x0054 /*error - out of memory */
- #define dupVolume 0x0057 /*error - duplicate volume name */
- #define notBlockDev 0x0058 /*error - not a block device */
- #ifndef invalidLevel /*error - specifield level outside legal range */
- #define invalidLevel 0x0059
- #endif
- #define damagedBitMap 0x005A /*error - block number too large */
- #define badPathNames 0x005B /*error - invalid pathnames for ChangePath */
- #define notSystemFile 0x005C /*error - not an executable file */
- #define osUnsupported 0x005D /*error - Operating System not supported */
- #ifndef stackOverflow /*error - too many applications on stack */
- #define stackOverflow 0x005F
- #endif
- #define dataUnavail 0x0060 /*error - Data unavailable */
- #define endOfDir 0x0061 /*error - end of directory has been reached */
- #define invalidClass 0x0062 /*error - invalid FST call class */
- #define resNotFound 0x0063 /*error - file does not contain required resource */
-
- #define proDOS 0x0001 /*fileSysID - ProDOS/SOS */
- #define dos33 0x0002 /*fileSysID - DOS 3.3 */
- #define dos32 0x0003 /*fileSysID - DOS 3.2 */
- #define dos31 0x0003 /*fileSysID - DOS 3.1 */
- #define appleIIPascal 0x0004 /*fileSysID - Apple II Pascal */
- #define mfs 0x0005 /*fileSysID - Macintosh (flat file system) */
- #define hfs 0x0006 /*fileSysID - Macintosh (hierarchical file system) */
- #define lisa 0x0007 /*fileSysID - Lisa file system */
- #define appleCPM 0x0008 /*fileSysID - Apple CP/M */
- #define charFST 0x0009 /*fileSysID - Character FST */
- #define msDOS 0x000A /*fileSysID - MS/DOS */
- #define highSierra 0x000B /*fileSysID - High Sierra */
-
- #define characterFST 0x4000 /*FSTInfo.attributes - character FST */
- #define ucFST 0x8000 /*FSTInfo.attributes - SCM should upper case pathnames before passing them to the FST */
-
- #define onStack 0x8000 /*QuitRec.flags - place state information about quitting program on the quit return stack */
- #define restartable 0x4000 /*QuitRec.flags - the quitting program is capable of being restarted from its dormant memory */
-
- #define seedling 0x0001 /*storageType - standard file with seedling structure */
- #define sapling 0x0002 /*storageType - standard file with sapling structure */
- #define tree 0x0003 /*storageType - standard file with tree structure */
- #define pascalRegion 0x0004 /*storageType - UCSD Pascal region on a partitioned disk */
- #define extendedFile 0x0005 /*storageType - extended file type (with resource fork) */
- #define directoryFile 0x000D /*storageType - volume directory or subdirectory file */
-
- #define minorRelNum 0x00FF /*version - minor release number */
- #define majorRelNum 0x7F00 /*version - major release number */
- #define finalRel 0x8000 /*version - final release */
-
- typedef struct GSString255 {
- Word length; /* Number of Chars in text field */
- unsigned char text[255]; /* */
- } GSString255, *GSString255Ptr;
-
- typedef struct GSString32 {
- Word length; /* Number of characters in text field */
- unsigned char text[32]; /* */
- } GSString32, *GSString32Ptr;
-
- typedef struct ResultBuf255 {
- Word bufSize; /* */
- GSString255 bufString; /* */
- } ResultBuf255, *ResultBuf255Ptr;
-
- typedef struct ResultBuf32 {
- Word bufSize; /* */
- GSString32 bufString; /* */
- } ResultBuf32, *ResultBuf32Ptr;
-
- typedef struct ChangePathRecGS {
- Word pCount; /* */
- GSString255Ptr pathname; /* */
- GSString255Ptr newPathname; /* */
- } ChangePathRecGS, *ChangePathRecPtrGS;
-
- typedef struct CreateRecGS {
- Word pCount; /* */
- GSString255Ptr pathname; /* */
- Word access; /* */
- Word fileType; /* */
- LongWord auxType; /* */
- Word storageType; /* */
- LongWord eof; /* */
- LongWord resourceEOF; /* */
- } CreateRecGS, *CreateRecPtrGS;
-
- typedef struct DAccessRecGS {
- Word pCount; /* */
- Word devNum; /* */
- Word code; /* */
- Pointer list; /* */
- LongWord requestCount; /* */
- LongWord transferCount; /* */
- } DAccessRecGS, *DAccessRecPtrGS;
-
- typedef struct DevNumRecGS {
- Word pCount; /* */
- GSString32Ptr devName; /* */
- Word devNum; /* */
- } DevNumRecGS, *DevNumRecPtrGS;
-
- typedef struct DInfoRecGS {
- Word pCount; /* */
- Word devNum; /* */
- GSString32Ptr devName; /* */
- Word characteristics; /* */
- LongWord totalBlocks; /* */
- Word slotNum; /* */
- Word unitNum; /* */
- Word version; /* */
- Word deviceID; /* */
- } DInfoRecGS, *DInfoRecPtrGS;
-
- typedef struct DIORecGS {
- Word pCount; /* */
- Word devNum; /* */
- Pointer buffer; /* */
- LongWord requestCount; /* */
- LongWord startingBlock; /* */
- Word blockSize; /* */
- LongWord transferCount; /* */
- } DIORecGS, *DIORecPtrGS;
-
- typedef struct DirEntryRecGS {
- Word pCount; /* */
- Word refNum; /* */
- Word flags; /* */
- Word base; /* */
- Word displacement; /* */
- Pointer name; /* */
- Word entryNum; /* */
- Word fileType; /* */
- Longint eof; /* */
- LongWord blockCount; /* */
- TimeRec createDateTime; /* */
- TimeRec modDateTime; /* */
- Word access; /* */
- LongWord auxType; /* */
- Word fileSysID; /* */
- ResultBuf255Ptr optionList; /* */
- } DirEntryRecGS, *DirEntryRecPtrGS;
-
- typedef struct ExpandPathRecGS {
- Word pCount; /* */
- GSString255Ptr inputPath; /* */
- ResultBuf255Ptr outputPath; /* */
- Word flags; /* */
- } ExpandPathRecGS, *ExpandPathRecPtrGS;
-
- typedef struct FileInfoRecGS {
- Word pCount; /* */
- GSString255Ptr pathname; /* */
- Word *access; /* */
- Word fileType; /* */
- Longint auxType; /* */
- Word storageType; /* must be 0 for SetFileInfo */
- TimeRec createDateTime; /* */
- TimeRec modDateTime; /* */
- LongWord optionList; /* */
- LongWord eof; /* */
- LongWord blocksUsed; /* must be 0 for SetFileInfo */
- LongWord resourceEOF; /* must be 0 for SetFileInfo */
- LongWord resourceBlocks; /* must be 0 for SetFileInfo */
- } FileInfoRecGS, *FileInfoRecPtrGS;
-
- typedef struct FormatRecGS {
- Word pCount; /* */
- GSString32Ptr devName; /* device name pointer */
- GSString32Ptr volName; /* volume name pointer */
- Word fileSysID; /* file system ID */
- } FormatRecGS, *FormatRecPtrGS;
-
- typedef struct FSTInfoRecGS {
- Word pCount; /* */
- Word fstNum; /* */
- Word fileSysId; /* */
- ResultBuf255Ptr fstName; /* */
- Word version; /* */
- Word attributes; /* */
- Word blockSize; /* */
- LongWord maxVolSize; /* */
- LongWord maxFileSize; /* */
- } FSTInfoRecGS, *FSTInfoRecPtrGS;
-
- typedef struct InterruptRecGS {
- Word pCount; /* */
- Word intNum; /* */
- Word vrn; /* used only by BindInt */
- LongWord intCode; /* used only by BindInt */
- } InterruptRecGS, *InterruptRecPtrGS;
-
- typedef struct IORecGS {
- Word pCount; /* */
- Word refNum; /* */
- Pointer dataBuffer; /* */
- LongWord requestCount; /* */
- LongWord transferCount; /* */
- Word cachePriority; /* */
- } IORecGS, *IORecPtrGS;
-
- typedef struct LevelRecGS {
- Word pCount; /* */
- Word level; /* */
- } LevelRecGS, *LevelRecPtrGS;
-
- typedef struct NameRecGS {
- Word pCount; /* */
- GSString255Ptr name; /* full pathname or a filename depending on call */
- } NameRecGS, *NameRecPtrGS;
-
- typedef struct NewlineRecGS {
- Word pCount; /* */
- Word refNum; /* */
- Word enableMask; /* */
- Word numChars; /* */
- Pointer newlineTable; /* */
- } NewlineRecGS, *NewlineRecPtrGS;
-
- typedef struct OpenRecGS {
- Word pCount; /* */
- Word refNum; /* */
- GSString255Ptr pathname; /* */
- Word requestAccess; /* */
- Word resourceNumber; /* For extended files: dataFork/resourceFork */
- Word access; /* Value of file's access attribute */
- Word fileType; /* Value of file's fileType attribute */
- Word auxType; /* */
- Word storageType; /* */
- TimeRec createDateTime; /* */
- TimeRec modDateTime; /* */
- Word *optionList; /* */
- LongWord eof; /* */
- LongWord blocksUsed; /* */
- LongWord resourceEOF; /* */
- LongWord resourceBlocks; /* */
- } OpenRecGS, *OpenRecPtrGS;
-
- typedef struct PositionRecGS {
- Word pCount; /* */
- Word refNum; /* */
- LongWord position; /* */
- } PositionRecGS, *PositionRecPtrGS;
-
- typedef struct PrefixRecGS {
- Word pCount; /* */
- Word prefixNum; /* */
- GSString255Ptr prefix; /* */
- } PrefixRecGS, *PrefixRecPtrGS;
-
- typedef struct QuitRecGS {
- Word pCount; /* */
- GSString255Ptr pathname; /* pathname of next app to run */
- Word flags; /* */
- } QuitRecGS, *QuitRecPtrGS;
-
- typedef struct RefNumRecGS {
- Word pCount; /* */
- Word refNum; /* */
- } RefNumRecGS, *RefnumRecPtrGS;
-
- typedef struct SetPositionRecGS {
- Word pCount; /* */
- Word refNum; /* */
- Word base; /* */
- LongWord displacement; /* */
- } SetPositionRecGS, *SetPositionRecPtrGS;
-
- typedef struct SysPrefRecGS {
- Word pCount; /* */
- Word preferences; /* */
- } SysPrefRecGS, *SysPrefRecPtrGS;
-
- typedef struct VersionRecGS {
- Word pCount; /* */
- Word version; /* */
- } VersionRecGS, *VersionRecPtrGS;
-
- typedef struct VolumeRecGS {
- Word pCount; /* */
- GSString32Ptr devName; /* */
- ResultBuf255Ptr volName; /* */
- LongWord totalBlocks; /* */
- LongWord freeBlocks; /* */
- Word fileSysID; /* */
- Word blockSize; /* */
- } VolumeRecGS, *VolumeRecPtrGS;
-
- /* make the old prodos calls use the new call method */
- #define PDosInt(callnum,pBlockPtr) sysCall(pBlockPtr,callnum)
-
- #define stackEntry 0xE100B0
- extern pascal void sysCall() inline(0x0000,stackEntry);
-
- #define GetSysPrefsGS(pBlockPtr) SysCall(pBlockPtr,0x200F)
- #define BeginSessionGS(pBlockPtr) SysCall(pBlockPtr,0x201D)
- #define EndSessionGS(pBlockPtr) SysCall(pBlockPtr,0x201E)
- #define SessionStatusGS(pBlockPtr) SysCall(pBlockPtr,0x201F)
- #define ResetCacheGS(pBlockPtr) SysCall(pBlockPtr,0x2026)
- #define ChangePathGS(pBlockPtr) SysCall(pBlockPtr,0x2004)
- #define ClearBackupBitGS(pBlockPtr) SysCall(pBlockPtr,0x200B)
- #define CloseGS(pBlockPtr) SysCall(pBlockPtr,0x2014)
- #define CreateGS(pBlockPtr) SysCall(pBlockPtr,0x2001)
- #define DControlGS(pBlockPtr) SysCall(pBlockPtr,0x202E)
- #define DestroyGS(pBlockPtr) SysCall(pBlockPtr,0x2002)
- #define DInfoGS(pBlockPtr) SysCall(pBlockPtr,0x202C)
- #define DReadGS(pBlockPtr) SysCall(pBlockPtr,0x202F)
- #define DStatusGS(pBlockPtr) SysCall(pBlockPtr,0x202D)
- #define DWriteGS(pBlockPtr) SysCall(pBlockPtr,0x2030)
- #define EraseDiskGS(pBlockPtr) SysCall(pBlockPtr,0x2025)
- #define ExpandPathGS(pBlockPtr) SysCall(pBlockPtr,0x200E)
- #define FlushGS(pBlockPtr) SysCall(pBlockPtr,0x2015)
- #define FormatGS(pBlockPtr) SysCall(pBlockPtr,0x2024)
- #define GetBootVolGS(pBlockPtr) SysCall(pBlockPtr,0x2028)
- #define GetDevNumberGS(pBlockPtr) SysCall(pBlockPtr,0x2020)
- #define GetDirEntryGS(pBlockPtr) SysCall(pBlockPtr,0x201C)
- #define GetEOFGS(pBlockPtr) SysCall(pBlockPtr,0x2019)
- #define GetFileInfoGS(pBlockPtr) SysCall(pBlockPtr,0x2006)
- #define GetFSTInfoGS(pBlockPtr) SysCall(pBlockPtr,0x202B)
- #define GetLevelGS(pBlockPtr) SysCall(pBlockPtr,0x201B)
- #define GetMarkGS(pBlockPtr) SysCall(pBlockPtr,0x2017)
- #define GetNameGS(pBlockPtr) SysCall(pBlockPtr,0x2027)
- #define GetPrefixGS(pBlockPtr) SysCall(pBlockPtr,0x200A)
- #define GetVersionGS(pBlockPtr) SysCall(pBlockPtr,0x202A)
- #define NewlineGS(pBlockPtr) SysCall(pBlockPtr,0x2011)
- #define NullGS(pBlockPtr) SysCall(pBlockPtr,0x200D)
- #define OpenGS(pBlockPtr) SysCall(pBlockPtr,0x2010)
- #define QuitGS(pBlockPtr) SysCall(pBlockPtr,0x2029)
- #define ReadGS(pBlockPtr) SysCall(pBlockPtr,0x2012)
- #define SetEOFGS(pBlockPtr) SysCall(pBlockPtr,0x2018)
- #define SetFileInfoGS(pBlockPtr) SysCall(pBlockPtr,0x2005)
- #define SetLevelGS(pBlockPtr) SysCall(pBlockPtr,0x201A)
- #define SetMarkGS(pBlockPtr) SysCall(pBlockPtr,0x2016)
- #define SetPrefixGS(pBlockPtr) SysCall(pBlockPtr,0x2009)
- #define UnbindIntGS(pBlockPtr) SysCall(pBlockPtr,0x2032)
- #define VolumeGS(pBlockPtr) SysCall(pBlockPtr,0x2008)
- #define WriteGS(pBlockPtr) SysCall(pBlockPtr,0x2013)
- #define BindIntGS(pBlockPtr) SysCall(pBlockPtr,0x2031)
-
- #ifndef __prodos__
-
- #define GetSysPrefs GetSysPrefsGS
- #define BeginSession BeginSessionGS
- #define EndSession EndSessionGS
- #define SessionStatus SessionStatusGS
- #define ResetCache ResetCacheGS
- #define ChangePath ChangePathGS
- #define ClearBackupBit ClearBackupBitGS
- #define Close CloseGS
- #define Create CreateGS
- #define DControl DControlGS
- #define Destroy DestroyGS
- #define DInfo DInfoGS
- #define DRead DReadGS
- #define DStatus DStatusGS
- #define DWrite DWriteGS
- #define EraseDisk EraseDiskGS
- #define ExpandPath ExpandPathGS
- #define Flush FlushGS
- #define Format FormatGS
- #define GetBootVol GetBootVolGS
- #define GetDevNumber GetDevNumberGS
- #define GetDirEntry GetDirEntryGS
- #define GetEOF GetEOFGS
- #define GetFileInfo GetFileInfoGS
- #define GetFSTInfo GetFSTInfoGS
- #define GetLevel GetLevelGS
- #define GetMark GetMarkGS
- #define GetName GetNameGS
- #define GetPrefix GetPrefixGS
- #define GetVersion GetVersionGS
- #define Newline NewlineGS
- #define Null NullGS
- #define Open OpenGS
- #define Quit QuitGS
- #define Read ReadGS
- #define SetEOF SetEOFGS
- #define SetFileInfo SetFileInfoGS
- #define SetLevel SetLevelGS
- #define SetMark SetMarkGS
- #define SetPrefix SetPrefixGS
- #define UnbindInt UnbindIntGS
- #define Volume VolumeGS
- #define Write WriteGS
- #define BindInt BindIntGS
- #define ChangePath ChangePathGS
- #define ClearBackupBit ClearBackupBitGS
- #define Close CloseGS
- #define Create CreateGS
- #define DControl DControlGS
- #define Destroy DestroyGS
- #define DInfo DInfoGS
- #define DRead DReadGS
- #define DStatus DStatusGS
- #define DWrite DWriteGS
- #define EraseDisk EraseDiskGS
- #define ExpandPath ExpandPathGS
- #define Flush FlushGS
- #define Format FormatGS
- #define GetBootVol GetBootVolGS
- #define GetDevNumber GetDevNumberGS
- #define GetDirEntry GetDirEntryGS
- #define GetEOF GetEOFGS
- #define GetFileInfo GetFileInfoGS
- #define GetFSTInfo GetFSTInfoGS
- #define GetLevel GetLevelGS
- #define GetMark GetMarkGS
- #define GetName GetNameGS
- #define GetPrefix GetPrefixGS
- #define GetVersion GetVersionGS
- #define Newline NewlineGS
- #define Null NullGS
- #define Open OpenGS
- #define Quit QuitGS
- #define Read ReadGS
- #define SetEOF SetEOFGS
- #define SetFileInfo SetFileInfoGS
- #define SetLevel SetLevelGS
- #define SetMark SetMarkGS
- #define SetPrefix SetPrefixGS
- #define UnbindInt UnbindIntGS
- #define Volume VolumeGS
- #define Write WriteGS
-
- #define ChangePathRec ChangePathRecGS
- #define CreateRec CreateRecGS
- #define DAccessRec DAccessRecGS
- #define DevNumRec DevNumRecGS
- #define DInfoRec DInfoRecGS
- #define DIORec DIORecGS
- #define DirEntryRec DirEntryRecGS
- #define ExpandPathRec ExpandPathRecGS
- #define FileInfoRec FileInfoRecGS
- #define FormatRec FormatRecGS
- #define FSTInfoRec FSTInfoRecGS
- #define InterruptRec InterruptRecGS
- #define IORec IORecGS
- #define LevelRec LevelRecGS
- #define NameRec NameRecGS
- #define NewlineRec NewlineRecGS
- #define OpenRec OpenRecGS
- #define PositionRec PositionRecGS
- #define PrefixRec PrefixRecGS
- #define QuitRec QuitRecGS
- #define RefNumRec RefNumRecGS
- #define SetPositionRec SetPositionRecGS
- #define SysPrefRec SysPrefRecGS
- #define VersionRec VersionRecGS
- #define VolumeRec VolumeRecGS
- #define DInfoRec DInfoRecGS
- #define FSTInfoRec FSTInfoRecGS
- #define OpenRec OpenRecGS
- #define VersionRec VersionRecGS
-
- #endif
-
- #endif
-
-